<?php

namespace App\Repository\Models;

use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class UserIm.
 *
 * @package namespace App\Repository\Models;
 */
class UserIm extends Model implements Transformable
{
    use TransformableTrait;
    use SoftDeletes;

    protected $table = 'user_im';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['user_id','accid','name','token','password'];

    public function user()
    {
        return $this->hasOne(User::class,'id','user_id');//  关联表id - 本表 外键
    }
    //认证信息
    public  function company(){
        return $this->hasOne(Company::class, 'user_id', 'user_id');
    }
}
